/*
 * @Author: byAcya xiaoxianbin@4399inc.com
 * @Date: 2025-02-10 09:29:39
 * @LastEditors: byAcya xiaoxianbin@4399inc.com
 * @LastEditTime: 2025-02-10 09:54:27
 * @FilePath: \CocosFramework\assets\script\core\utils\Instance.ts
 * @Description:   单例
 */


export type IClass<T> = new (...args: any[]) => T;


export default class Instance {
  public static get<T>(c:IClass<T>,...params:any[]):T{
    if(c['__Instance__'] == null){
        c['__Instance__'] = new c(...params);
    }
    return c['__Instance__'];
  }
}


